import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.*;

import java.util.stream.Stream;

public class JunitTest02 {

    public static Stream<Arguments> Generator() {
        return Stream.of(Arguments.arguments(
                "1, 张三",
                "2, 李四"
        ));
    }

    @ParameterizedTest
    @ValueSource(ints = {1,2,3})
    public void Test01(int num) {
        //System.out.println(num);
//        Assertions.assertEquals(num,1);
//        Assertions.assertNotEquals(num,2);
        String str = "nullX";
        Assertions.assertNull(str);
    }

    @ParameterizedTest
    @CsvSource({"1, 2, 3, ''"})
    public void Test02(String x, String y,int z,String q) {
        System.out.println(x);
        System.out.println(y);
        System.out.println(z);
        System.out.println(q);
        System.out.println("===========================");
    }

    @ParameterizedTest
    @CsvFileSource(resources = "test02.csv")
    public void Test03(int num, String name) {
        System.out.println("num: " + num + "| name :" + name);
    }

    @ParameterizedTest
    @MethodSource("Generator")
    public void Test04(String name1, String name2) {
        System.out.println(name1);
        System.out.println(name2);
    }

}
